//added a second constructor-cat


#include "Player.h"
#include <iostream>
#include "Card.h"
#include "Meld.h"

using std::ostream;
using std::cout;
using std::endl;

Player:: Player(string str1):name(str1){}

Player::Player(string str1, string playertype)
{
	name = str1;
	type = playertype;
	firstMoveDone=false;//when construct,should be false
	hand=vector<Card>();
	handBuffer=vector<Card>();	
// : name(str1), type(playertype) {}
	cout << "Just created " << name << " which is " << type << endl;
}

ostream & Player::displayTableBuffer(ostream &os,vector<Meld*> &tb2)
{
  for(int i=0;i<tb2.size();i++)
    {
      os<<"\tMeld["<<(i+1)<<"]:"<<(*(tb2.at(i)))<<endl;

    }
  return os;
}
ostream &Player::displayHand(ostream &os)
{
  for(int i=0;i<hand.size();i++)
    {
      os<<hand.at(i)<<" ";
    }
}

ostream &Player::displayHandBuffer(ostream &os)
{
  for(int i=0;i<handBuffer.size();i++)
    {
      os<<handBuffer.at(i)<<" ";
    }

}

ostream & Player::display(ostream &os)const
{
  os<<"oops, player is the general type, dynamic binding fail"<<std::endl;
  return os;
}

bool Player::move(vector<Meld*>& tb2)
{
  cout<<"---Should not be calling generic move in Player class. Get me out of here.";
	return false;
}
